package org.lmw.mm.ctrl;

import java.lang.reflect.Type;
import java.util.List;
import java.util.Map;

import org.lmw.mm.dao.User;

import com.google.gson.Gson;
import com.google.gson.reflect.TypeToken;
import com.jfinal.core.Controller;

public class BaseCtrl extends Controller {
  static String error_code="0";
  static String success_code="1";
	Gson gson=new Gson();
	Type type_map = new TypeToken<Map<String, String>>() {}.getType(); 
	Type type_list = new TypeToken<List<Object>>() {}.getType(); 
	
	Map<String, Object> res=null;//返回结果
	public int getUID(){
		if(null!=getSessionAttr("sessionUser")){
		User u=getSessionAttr("sessionUser");
		return u.getInt("id");
		}
		return 0;
	}
	
}
